<div ng-include="sys_html('_header')"></div>
<style>
    .fui-footer .btn{
        border-radius: 1rem;
        margin-top: .6rem;
        min-width: 4.1rem;
    }
    .fui-footer{
        padding-right: .6rem;
    }
    .fui-footer .btn.btn-default-o {
        border-color: #666;
        color: #666;
    }
    .fui-title.r-group{
        background: #f3f3f3;
        margin: 0;
        padding: .5rem .6rem;
    }
    .fui-cell-group .fui-cell.noborder:before{
        border:0;
    }
</style>
<div ng-class="{'fui-page':1, 'fui-page-current': pagedata.order.refundstate}" id='page-refund-edit' >
<div class="fui-header">
    <div class="fui-header-left">
        <a class="back" onclick='history.back()'></a>
    </div>
    <div class="title">{{pagedata.order.status==1?'退款':'售后'}}申请</div>
    <div class="fui-header-right">&nbsp;</div>
</div>
<div class='fui-content  navbar'>
    <div class="fui-cell-group">
        <div class="fui-cell">
            <div class="fui-cell-label">处理方式</div>
            <div class="fui-cell-info">

                <select id="rtype">
                    <option ng-if="pagedata.order.status==2||pagedata.order.status==3" value="1" ng-selected="pagedata.refund.rtype==1">退货退款</option>
                    <option ng-if="pagedata.order.status==2||pagedata.order.status==3" value="1"  value="2" ng-selected="pagedata.refund.rtype==2">换货</option>
                    <option value="0" ng-selected="pagedata.refund.rtype==0">退款(仅退款不退货)</option>
                </select>
            </div>
            <div class="fui-cell-remark"></div>

        </div>
        <div class="fui-cell">
            <div class="fui-cell-label"><span class="re-g">{{pagedata.refund.rtype=='2'?'换货':'退款'}}</span>原因</div>
            <div class="fui-cell-info">

                <select id="reason">
                    <option value="不想要了" ng-selected="pagedata.refund.reason=='不想要了'">不想要了</option>
                    <option value="卖家缺货" ng-selected="pagedata.refund.reason=='卖家缺货'">卖家缺货</option>
                    <option value="拍错了/订单信息错误" ng-selected="pagedata.refund.reason=='拍错了/订单信息错误'">拍错了/订单信息错误</option>
                    <option value="其它" ng-selected="pagedata.refund.reason=='其它'">其它</option>
                </select>
            </div>
            <div class="fui-cell-remark"></div>
        </div>

        <div class="fui-cell">
            <div class="fui-cell-label"><span class="re-g">{{pagedata.refund.rtype=='2'?'换货':'退款'}}</span>说明</div>
            <div class="fui-cell-info c000" >
                <input type="text" id="content" class='fui-input' placeholder="选填" value="{$refund['content']}"/>
            </div>
        </div>

        <div ng-if="pagedata.refund.rtype!=2" class="fui-cell r-group">
        <div class="fui-cell-label">退款金额</div>
        <div class="fui-cell-info c000" style="    display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;-webkit-box-align: center;-webkit-align-items: center;-ms-flex-align: center;align-items: center;">
            ￥<input type="number" id="price" class='fui-input' placeholder="请输入需要退的金额" value="{{pagedata.order.refundprice}}" />
        </div>


    </div>
    <div class="fui-cell">
        <div class="fui-cell-label">上传凭证</div>
        <div class="fui-cell-info">

            <ul class="fui-images fui-images-sm" id="images">
				<div ng-repeat="(k,v) in pagedata.refund.imgs">
                <input type="hidden" name="images[]" value="{{v}}" />
                <li style="background-image:url({{tomedia(v)}})" class="image image-sm" data-filename="{{v}}"><span class="image-remove"><i class="icon icon-close"></i></span></li>
				</div>

            </ul>
            <div ng-if="pagedata.refund.imgs.length !=5" class="fui-uploader fui-uploader-sm refund-container-uploader"
            data-name="images[]"
            data-max="5"
            data-count="{{pagedata.refund.imgs.length}}">
            <input type="file" name='imgFile0' id='imgFile0'>
        </div>

    </div>
</div>

<div ng-if="pagedata.refund.rtype!=2"class='fui-title r-group'>
<span class='text-danger'>*提示:您可退款的最大金额为￥{{pagedata.order.refundprice}}</span>
</div>

</div>


</div>
<div class='fui-footer text-right'>
    <a class='btn btn-sm btn-danger-o btn-submit'>提交申请</a>
    <a class="btn btn-sm btn-default-o back">取消</a>
</div>
</div>

<div ng-class="{'fui-page':1,  'fui-page-current':pagedata.order.refundstate}" id='page-refund-info'>
<div class="fui-header">
    <div class="fui-header-left">
        <a class="back" onclick='history.back()'></a>
    </div>
    <div class="title">{{pagedata.order.status==1?'退款':'售后'}}申请</div>
    <div class="fui-header-right">&nbsp;</div>
</div>
<div class='fui-content  navbar'>
    <div class='fui-cell-group'>
            <div class='fui-cell noborder' style="padding-bottom: 0">
                <!--<i class='icon icon-info'></i>-->
					<span class="text">{{pagedata.refund.status==0?'等待商家处理':pagedata.order.status==1?'退款申请':'售后申请'}}
						{{pagedata.refund.status>=3?'等待商家处理':pagedata.order.status==1?'退款申请':'售后申请'}}
					</span>
            </div>
            <div class='fui-cell' ng-if="pagedata.refund.rtype==0 && pagedata.refund.status==0" style="color: #999;font-size: .65rem;line-height: 1.2rem">
                    退款申请流程： <br> 1、发起退款申请<br>2、商家确认后退款到您的账户
                    如果商家未处理：请及时与商家联系
            </div>
			<div class='fui-cell' ng-if="pagedata.refund.rtype==1" style="color: #999;font-size: .65rem;line-height: 1.2rem">
                    退款退货申请流程：<br>1、发起退款退货申请<br>2、退货需将退货商品邮寄至商家指定地址，并在系统内输入快递单号<br>3、商家收货后确认无误<br>4、退款到您的账户
            </div>
			<div class='fui-cell' ng-if="pagedata.refund.rtype==2" style="color: #999;font-size: .65rem;line-height: 1.2rem">
                    换货申请流程：<br>1、发起换货申请，并把快递单号录入系统<br>2、将需要换货的商品邮寄至商家指定地址，并在系统内输入快递单号<br>3、商家确认后货后重新发出商品<br>4、签收确认商品
            </div>
    </div>
    <div ng-if="pagedata.refund.status>=3 && pagedata.refund.refundaddress" class="fui-list-group" style='margin-top:5px;'>
        <div class="fui-list-group-title"><i class='icon icon-location'></i> 退货地址</div>
        <div class="fui-list">
            <div class="fui-list-media"></div>
            <div class="fui-list-inner">
                <div class='text'>{{pagedata.refund.refundaddress.province}}{{pagedata.refund.refundaddress.city}}{{pagedata.refund.refundaddress.area}} {{pagedata.refund.refundaddress.address}}</div>
                <div class='subtitle'>{{pagedata.refund.refundaddress.name}} {pagedata.refund.refundaddress.mobile}} {{pagedata.refund.refundaddress.tel}}</div>
            </div>
        </div>
        <div ng-if="pagedata.refund.message" class="fui-list-group-title"><i class='icon icon-message'></i> 卖家留言</div>
        <div ng-if="pagedata.refund.message" class="fui-list">
            <div class="fui-list-media"></div>
            <div class="fui-list-inner">
                <div class='text'><span class='text-danger'>{{pagedata.refund.message}}</span></div>

            </div>
        </div>

    </div>

    <div ng-if="pagedata.refund.rtype>=3 && (pagedata.refund.rtype==1 || pagedata.refund.rtype==2)" class="fui-cell-group">

        <a ng-class="{'fui-cell':1, fui-cell-click':pagedata.refund.status==3}">
			<div class="fui-cell-label">{{pagedata.refund.rtype==1?'退货':'换货'}}状态</div>
			<div class='fui-cell-info'></div>
			<div ng-class="{'fui-cell-remark':1,  'noremark':refund.status!=3}">
				{{pagedata.refund.status==3?'需填写快递单号':pagedata.refund.status==4?'等待商家确认':'商家已经发货'}}
			</div>
		</a>

		<div ng-if="pagedata.refund.rtype>=3 && pagedata.refund.rexpresssn" class="fui-cell">
			<div class="fui-cell-label">{{pagedata.refund.rtype==1?'退货':'换货'}}快递公司</div>
			<div class='fui-cell-info'>{{pagedata.refund.rexpresscom}}</div>
		</div>
		<div ng-if="pagedata.refund.rtype>=3 && pagedata.refund.rexpresssn" class="fui-cell">
			<div class="fui-cell-label">{{pagedata.refund.rtype==1?'退货':'换货'}}快递公司</div>
			<div class='fui-cell-info'>{{pagedata.refund.rexpresscom}}</div>
		</div>
	</div>
<div class='fui-title'>协商详情</div>
<div class="fui-cell-group">
    <div class="fui-cell">
        <div class="fui-cell-label">处理方式</div>
        <div class="fui-cell-info">

        </div>
        <div class="fui-cell-remark noremark">
			{{pagedata.refund.rtype==0?'退货':pagedata.refund.rtype==1?'退货退款':'换货'}}
        </div>
    </div>
    <div class="fui-cell">
        <div class="fui-cell-label">{{pagedata.refund.rtype==2?'换货':'退款'}}原因</div>
        <div class="fui-cell-info "></div>
        <div class="fui-cell-remark noremark">
            {{pagedata.refund.reason}}
        </div>
        </div>
    <div class="fui-cell">
        <div class="fui-cell-label">{{pagedata.refund.rtype=='2'?'换货':'退款'}}说明</div>
        <div class="fui-cell-info "></div>
        <div class="fui-cell-remark noremark">{{pagedata.refund.content ?'无':pagedata.refund.content}}</div>
        </div>
    <div class="fui-cell" ng-if="pagedata.refund.applyprice>0 && pagedata.refund.rtype!=2" >
        <div class="fui-cell-label">退款金额</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark">￥{{pagedata.refund.applyprice}} </div>
    </div>

    <div class="fui-cell">
        <div class="fui-cell-label">申请时间</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark">{{date(pagedata.refund.createtime)}} </div>
    </div>

</div>

</div>
<div class='fui-footer text-right' ng-if="pagedata.refund.rtype==2 && pagedata.refund.status==5">
    <div class="btn btn-sm btn-danger-o btn-receive">确认收到换货物品</div>
    <a external data-nocache="true" ng-click="access_json('/order.refund.refundexpress//id='+pagedata.order.id+'&express='+pagedata.refund.rexpress+'&expresscom='+pagedata.refund.expresscom+'&expresssn='+pagedata.refund.expresssn)"><div class="btn btn-sm  btn-default-o">查看换货物流</div></a>
</div>
<div class='fui-footer text-right' ng-if="pagedata.refund.status==3 || pagedata.refund.status==4">
    <a data-nocache="true" class="btn btn-sm btn-danger-o" href='#page-refund-express'>{{!pagedata.refund.express ?'填写':'修改'}}快递单号</a>
</div>
<div class='fui-footer text-right' ng-if="pagedata.refund.status==0">
    <a data-nocache="true" class='btn btn-sm btn-danger-o btn-edit' href='#page-refund-edit'>修改申请</a>
</div>
<div class='fui-footer text-right' ng-if="pagedata.refund.status!=5">
    <a class='btn btn-sm btn-default-o btn-cancel'>取消申请</a>
</div>
</div>

<div class='fui-page' id='page-refund-express'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" onclick='history.back()'></a>
        </div>
        <div class="title">{{pagedata.order.status==1?'退款':'售后'}}申请</div>
        <div class="fui-header-right">&nbsp;</div>
    </div>
    <div class='fui-content margin'>
        <input type='hidden' id='express_old' value="{{pagedata.refund.express}}"/>
        <input type="hidden" name="expresscom" id="expresscom" value="{{pagedata.refund.expresscom}}">
        <div class="fui-cell-group">
            <div class='fui-cell-title'>填写快递单号</div>
            <div class="fui-cell">
                <div class="fui-cell-label">快递公司</div>
                <div class="fui-cell-info"><select id="express" name="express">
                    <option value="" data-name="其他快递">其他快递</option>
                    <option ng-repeat="value in pagedata.express_list" value="{{value.express}}" ng-model="value.name">{{value.name}}</option>
                </select></div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">快递单号</div>
                <div class="fui-cell-info"><input type="text" id="expresssn" class='fui-input' ng-model="pagedata.refund.expresssn" value="{{pagedata.refund.expresssn}}" max="50"/></div>
            </div>
        </div>

    </div>
    <div class='fui-footer text-right'>
        <div class="btn btn-sm btn-danger-o" id='express_submit'>提交快递单号</div>
        <a class="btn btn-sm btn-default-o back">返回</a>
    </div>
</div>
<div ng-include="sys_html('_footer')"></div>